{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "from matplotlib import pyplot as plt\n",
    "\n",
    "from solml.train import split\n",
    "\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "l = 16\n",
    "color = False\n",
    "train_ids, val_ids, test_ids, train_labels, val_labels, test_labels = split.two_balanced_classes()\n",
    "train_data, val_data, test_data = split.load_images(train_ids, val_ids, test_ids, l, color)\n",
    "train_data = train_data.reshape(len(train_ids), l*l)\n",
    "val_data = val_data.reshape(len(val_ids), l*l)\n",
    "test_data = test_data.reshape(len(test_ids), l*l)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def test(test_data, test_labels, l, intercept):\n",
    "    N, d = test_data.shape\n",
    "    assert (d == l*l)\n",
    "    sum_east = np.zeros(N)\n",
    "    sum_west = np.zeros(N)\n",
    "    sum_north = np.zeros(N)\n",
    "    sum_south = np.zeros(N)\n",
    "    cut = int(l/2)\n",
    "    for i in range(N):\n",
    "        image = test_data[i, :].reshape((l, l))\n",
    "        sum_east[i] = image[:, :cut].sum()\n",
    "        sum_west[i] = image[:, cut:].sum()\n",
    "        sum_north[i] = image[:cut, :].sum()\n",
    "        sum_east[i] = image[cut:, :].sum()\n",
    "        \n",
    "    delta_east_west = intercept+np.abs(sum_east - sum_west)\n",
    "    delta_north_south = np.abs(sum_north - sum_south)\n",
    "    \n",
    "    predicted_classes = 1+(delta_east_west<delta_north_south)\n",
    "\n",
    "    error_rate = (test_labels!=predicted_classes).sum()/len(test_labels)\n",
    "    \n",
    "    return error_rate"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "intercept_values = range(0, 20000, 100)\n",
    "error_rates = []\n",
    "for intercept in intercept_values:\n",
    "    error_rates.append(test(test_data, test_labels, l, intercept))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7f85e8142cc0>]"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX0AAAD8CAYAAACb4nSYAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xt83GWZ8P/PNZNJJueknbRJc2hSKIW2QBMC5VABURBQ\ni8LqgqICuuw+u6yu664/3V1P6LMu+uju+lseFQUXPICo6FasVKxyqFBom/RcStscm0NzPmeSzMz9\n/DHfmU7SHKbNTGYyc71fr746853vfOeaQ66557rv732LMQallFLJwRbrAJRSSi0cTfpKKZVENOkr\npVQS0aSvlFJJRJO+UkolEU36SimVRDTpK6VUEtGkr5RSSUSTvlJKJZGUWAcwlcvlMuXl5bEOQyml\nFpU9e/Z0GWMK5tov7pJ+eXk5u3fvjnUYSim1qIhIYzj7aXlHKaWSiCZ9pZRKIpr0lVIqiWjSV0qp\nJKJJXymlkkhYSV9EbhaRoyJyXEQ+M83t94hIp4jstf59LOS250SkT0SejWTgSimlzt6cQzZFxA48\nDNwInAR2icgWY8zhKbv+1BjzwDSH+DqQAfzlfINVSik1P+GM078COG6MqQMQkaeA24CpSX9axpjt\nInL9OUeolEporX2jPL27GZ/Pv3RrYW46H9hYFuOoElc4Sb8YaA65fhLYOM1+d4jItcCbwCeNMc3T\n7DMtEbkfuB+grEzfbKWSyVO7mvnW9mOIQGDJ7rddtIzlOc7YBpagItWR+2ug3BhzCfA88PjZ3NkY\n84gxptoYU11QMOdZxEqpBNIzPEZ+hoP6r76Tx+6pBvytfxUd4ST9FqA05HqJtS3IGNNtjBmzrn4f\nuCwy4SmlEpExBmM16/tGJs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K58+h1c7rzqB5/x1G+dXlJhF67p4B7Y/2aMaVTL5KvEWd2sN06j7huBg4DBVP2KwDs1uVV\n+P/gZ338mZ7jOcYVsfcN/6++0I7cv57Pexnyur0Yq9eMmXNETD9nUUuKC/0Pf8/3m/i/uf95AR5v\nE/6fZfuBvda/W4EfAges7Vum/GH8sxXfUUJ62SMZu/VB3mf9OxQ4Hv666XbgGPD7kA+NAA9bj30A\nqA451n34O+GOE5Kk5xlfJv6WXW7ItgV/zfD/5G8DJvDXQj8aydcIqAYOWvf5L6wTIc8xruP4a7qB\nz9l3rH3vsN7jvUAN8O65Hn+m53iOcUXsfbM+t69bz/VnQNp83ktr+38DfzVl34V8zWbKETH9nOkZ\nuUoplUQSpaavlFIqDJr0lVIqiWjSV0qpJKJJXymlkogmfaWUSiKa9JVSKolo0ldKqSSiSV8ppZLI\n/wOlfs0PUP4VkAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f85e9acdba8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(intercept_values, error_rates)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
